 <template>
  <div class="page">
    <div class="top">
      <c-title :hide="false" text="易货订单详情"></c-title>
    </div>
    <div class="content">
      <div class="xq">
        <div class="imgclass">
          <img v-if="List.goods_info" :src="List.goods_info.business_pic" alt="" />

          <div class="item" v-if="List.goods_info">
            <div class="l">商品名称：</div>
            <div class="r">{{ List.goods_info.name }}</div>
          </div>
          <div class="item" v-if="List.goods_info">
            <div class="l">品牌：</div>
            {{ List.goods_info.goods_brand }}
          </div>
          <div class="item" v-if="List.goods_info">
            <div class="l">介绍：</div>
            {{ List.goods_info.goods_desc }}
          </div>
          <div class="item">
            <div class="l">订单价格：</div>
            <div class="r">{{ List.price }}</div>
          </div>
          <div class="item">
            <div class="l">订单编号：</div>
            <div class="r">{{ List.order_sn }}</div>
          </div>
          <div class="item" v-if="List.goods_info">
            <div class="l">下单时间：</div>
            <div class="r">{{ List.add_time }}</div>
          </div>
          <div class="item" v-if="List.order_status>0">
            <div class="l">支付时间：</div>
            <div class="r">{{ List.pay_time ==null?"暂未支付":List.pay_time}}</div>
          </div>
          <div class="item" v-if="List.wuliu != null">
            <div class="l">物流信息：</div>
            <div class="r">{{ List.wuliu }}</div>
          </div>
          <div class="item" v-if="List.danhan != null">
            <div class="l">物流单号：</div>
            <div class="r">{{ List.danhan }}</div>
          </div>

          <div class="item" v-if="List.order_status > 0">
            <div class="l">订单状态：</div>
            <div class="r">{{ List.order_status == 1 ? "待发货" : List.order_status == 2 ? "待确认" : "已完成" }}</div>
          </div>

          <div class="item">
            <div class="l">数量：</div>
            <div class="r">{{ List.num }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
 
 <script>
export default {
  data() {
    return {
      order_id: "",
      List: {}
    };
  },
  activated() {
    this.order_id = this.$route.query.order_id;
    this.getList();
  },
  methods: {
    getList() {
      $http.post("plugin.store-yihuo.frontend.store.yihuo.orderinfo", { order_id: this.order_id }).then(response => {
        this.List = response.data;
      });
    }
  }
};
</script>
 
 <style lang="scss" scoped>
.page {
  h1 {
    font-size: 1rem;
    margin: 1rem 0rem;
  }
  .content {
    margin: 1rem;
  }
  .imgclass {
    margin-right: 1rem;

    .item {
      display: flex;
       margin: 1rem 0rem 0rem 2rem;
      .l {
        font-weight: 600;
        font-size: 0.95rem;
      }
      .r {
        font-size: 1rem;
      }
    }
    img {
      width: 80%;
      height: 10rem;
    }
  }
}
</style>